#ifndef OPTION_BUTTON_H

#define OPTION_BUTTON_H

#include <QPushButton>
#include <QSize>

class OptionButton: public QPushButton
{
	Q_OBJECT

public:

	OptionButton(QWidget * parent = 0): QPushButton(parent)
	{
		connect(this, SIGNAL(pressed()), this, SLOT(buttonPressed()));
		connect(this, SIGNAL(released()), this, SLOT(buttonReleased()));
	};
	~OptionButton(){};

protected:

	void enterEvent ( QEvent * event )
	{
		setIconSize(QSize(34, 34));
	};

	void leaveEvent ( QEvent * event )
	{
		setIconSize(QSize(32, 32));
	};

public slots:

	void buttonPressed(){
		setStyleSheet(QString::fromUtf8(
					"background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(90, 90, 90, 255), stop:1 rgba(142, 142, 142, 255));\n"
					"color: rgb(255, 255, 255);\n"
					""));
		setIconSize(QSize(32, 32));
	};

	void buttonReleased()
	{
		setStyleSheet(QString::fromUtf8(
					"background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(57, 57, 57, 255), stop:1 rgba(122, 122, 122, 255));\n"
					"color: rgb(255, 255, 255);\n"
					""));
		setIconSize(QSize(34, 34));
	};

};

#endif
